package com.woniu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CtfContainer implements Serializable {
     /* 容器ID
     */
    @TableId(value = "container_id", type = IdType.NONE)
    private String containerId;

    /**
     * 靶场ID
     */
    private String rangeId;

    /**
     * 靶场入口url
     */
    private String socket;

    /**
     * 密钥flag值
     */
    private String flagValue;

    /**
     * 正误
     */
    private Integer isFlagMatch;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建者
     */
    private Integer userId;

    /**
     * 容器销毁时间
     */
    private Date updateTime;

    /**
     * 销毁者
     */
    private String updater;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CtfContainer other = (CtfContainer) that;
        return (this.getContainerId() == null ? other.getContainerId() == null : this.getContainerId().equals(other.getContainerId()))
            && (this.getRangeId() == null ? other.getRangeId() == null : this.getRangeId().equals(other.getRangeId()))
            && (this.getSocket() == null ? other.getSocket() == null : this.getSocket().equals(other.getSocket()))
            && (this.getFlagValue() == null ? other.getFlagValue() == null : this.getFlagValue().equals(other.getFlagValue()))
            && (this.getIsFlagMatch() == null ? other.getIsFlagMatch() == null : this.getIsFlagMatch().equals(other.getIsFlagMatch()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getContainerId() == null) ? 0 : getContainerId().hashCode());
        result = prime * result + ((getRangeId() == null) ? 0 : getRangeId().hashCode());
        result = prime * result + ((getSocket() == null) ? 0 : getSocket().hashCode());
        result = prime * result + ((getFlagValue() == null) ? 0 : getFlagValue().hashCode());
        result = prime * result + ((getIsFlagMatch() == null) ? 0 : getIsFlagMatch().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", containerId=").append(containerId);
        sb.append(", rangeId=").append(rangeId);
        sb.append(", socket=").append(socket);
        sb.append(", flagValue=").append(flagValue);
        sb.append(", flagIsMatch=").append(isFlagMatch);
        sb.append(", createTime=").append(createTime);
        sb.append(", creator=").append(userId);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updater=").append(updater);
        sb.append("]");
        return sb.toString();
    }
}